import request from "@/utils/request";



export function getHomeworkList(params:any) {
    return request({
        url: '/api/homework',
        method: 'get',
        params
    });
}


export function getHomeworkDetail(id:string) {
    return request({
        url: `/api/homework/${id}`,
        method: 'get'
    });
}


export function updateHomework(data:any) {
    return request({
        url: `/api/homework/${data.id}`,
        method: 'put',
        data
    });
}


export function deleteHomework(id:string) {
    return request({
        url: `/api/homework/${id}`,
        method: 'delete'
    });
}


export function batchDeleteHomework(ids:string[]) {
    return request({
        url: '/api/homework/batch',
        method: 'post',
        data: ids
    });
}


export function createHomework(data:any){
    return request({
        url:'/api/homework',
        method: "post",
        data
    });
}


// export function getStudentList() {
//     return request({
//         url: '/api/homework/student',  // 假设接口返回 [{ id, name }]
//         method: 'get'
//     })
// }

export function getTeacherList() {
    return request({
        url: '/api/homework/teacher',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}